package springboot.p2.resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @description: 测试
 * @author: lzp
 * @createTime: 2021-08-28 01:02
 **/
public class Main {

    @Autowired
    private static ConfigService configService;

    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(Config.class);
        ConfigService configService = context.getBean(ConfigService.class);
        System.out.println(configService.getBookAuthor());
        System.out.println(configService.getBookName());

        ValueService valueService = context.getBean(ValueService.class);
        System.out.println(valueService.getAuthor());
        System.out.println(valueService.getName());
    }
}
